<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>话题详情</title>
    <script type="text/javascript" src="../js/jquery-3.5.1.min.js"></script>
    <script type="text/javascript" src="../js/common.js"></script>
    <style>

        .left{
            float: left;
        }
        .right{
            float: right;
        }
        .clear{
            clear: both;
        }

        .header{
            border-bottom: 1px solid gray;
            position: fixed;
            top: 0;
            width: 100vw;
            height: 10vw;
            background-color: #fff;
        }
        .header img{
            width: 5vw;
            height: 5vw;
            padding: 2.5vw;
        }
        .container{
            width: 95vw;
            margin: 12vw auto;
        }

        textarea{
            width: 90vw;
            max-width: 90vw;
            margin: auto;
            height: 80vw;
            padding: 2%;
            border: 1px solid gray;
            font-size: 16px;
        }

        .footer-div{
            color: #fff;
            background-color: #ff0000;
            width: 100vw;
            height: 10vw;
            line-height: 10vw;
            text-align: center;
            font-size: 28px;
            position: fixed;
            bottom: 0;
            left: 0;
        }
    </style>
</head>
<body>

<div class="header">
    <img onclick="window.close();" class="left" src="../images/back-128-128.png" alt="返回">
    <img onclick="location.reload();" class="right" src="../images/flush-128-128.png" alt="刷新">
    <div class="clear"></div>
</div>

<div class="container">

    <textarea name="" id=""></textarea>

</div>

<div class="footer-div" onclick="fnPostTitles();">提交</div>

</body>

<script type="text/javascript">
    $().ready(function () {

    });

    function fnPostTitles() {

        var text = $('textarea').val();

        console.log(text);

        $.ajax({
            url: base_request_url + 'topics',
            type: 'post',
            data: {
              titles: text
            },
            success: function (res) {
                console.log(res)
                if (res.code == '0') {
                    alert(JSON.stringify(res.meta));
                } else {
                    alert(res.msg);
                }
            }
        })
    }
</script>
</html>
